package com.source.java.array;

import com.sun.jmx.remote.internal.ArrayQueue;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;

/**
 * @author xubangbang
 * @date 2021/7/30 14:43
 */
public class TestApp {

    static {
        int initialCapacity = 7;
        System.out.println(initialCapacity >> 1);
        System.out.println(initialCapacity);
        System.out.println(initialCapacity >>> 1);
        initialCapacity |= (initialCapacity >>> 1);
        System.out.println(initialCapacity);
        initialCapacity |= (initialCapacity >>> 2);
        System.out.println(initialCapacity);
        initialCapacity |= (initialCapacity >>> 4);
        System.out.println(initialCapacity);
        initialCapacity |= (initialCapacity >>> 8);
        System.out.println(initialCapacity);
        initialCapacity |= (initialCapacity >>> 16);
        System.out.println(initialCapacity);

    }


    public static void main(String[] args) {
        System.out.println(Integer.toBinaryString(2));
        System.out.println(Integer.toBinaryString(-5));
        System.out.println(-5>>2);

    }

    private static <T> T pop(List<T> list) {
        if (null == list || list.size() == 0) {
            return null;
        } else {
            return list.remove(0);
        }
    }

    private static void addEle(List<Integer> list, int size) {
        for (int i = 0; i < size; i++) {
            list.add(i);
        }
    }

}
